<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>添加角色</title>
    <link rel="stylesheet" href="../../../../start/layui/css/style.css" media="all">
</head>
<style>
</style>
<body>
<div class="layui-fluid" style="padding: 15px">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-header">
                    人员信息操作
                </div>
                <div class="layui-input-inline "  >
                    <input type="hidden" name="personnelId"  lay-verify="required"  class="layui-input">
                </div>
                <div class="layui-card-body">
                    <form class="layui-form layui-form-pane" action="#"  lay-filter="example">
                        <div class="layui-row">
                            <div class="layui-col-md4">
                                <div class="layui-form-item ">
                                    <label class="layui-form-label">员工姓名</label>
                                    <div class="layui-input-inline "  >
                                        <input type="text" id="tmsName" name="tmsName"  lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
                                    </div>
                                </div>
                            </div>
                            <div class="layui-col-md4">
                                <div class="layui-form-item">
                                    <label class="layui-form-label">员工账号</label>
                                    <div class="layui-input-inline">
                                        <input type="text" id="account" name="account" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
                                    </div>
                                </div>
                            </div>
                            <div class="layui-col-md4">
                                <div class="layui-form-item">
                                    <label class="layui-form-label">员工密码</label>
                                    <div class="layui-input-inline">
                                        <input type="text" id="tmsPassword" name="tmsPassword" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="layui-row">
                            <div class="layui-col-md4">
                                <div class="layui-form-item">
                                    <label class="layui-form-label">员工手机</label>
                                    <div class="layui-input-inline">
                                        <input type="text" id="phonenumber"  name="phonenumber" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
                                    </div>
                                </div>
                            </div>
                            <div class="layui-col-md4">
                                <div class="layui-form-item">
                                    <label class="layui-form-label">家庭电话</label>
                                    <div class="layui-input-inline">
                                        <input type="text" id="hometelephone" name="hometelephone" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
                                    </div>
                                </div>
                            </div>
                            <div class="layui-col-md4">
                                <div class="layui-form-item">
                                    <label class="layui-form-label">工资数量</label>
                                    <div class="layui-input-inline">
                                        <input type="text" id="salary" name="salary" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="layui-row">
                            <div class="layui-col-md4">
                                <div class="layui-form-item">
                                    <label class="layui-form-label">出生日期</label>
                                    <div class="layui-input-inline">
                                        <input type="text"  id="birthday" name="birthday" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
                                    </div>
                                </div>
                            </div>
                            <div class="layui-col-md4">
                                <div class="layui-form-item">
                                    <label class="layui-form-label">入职日期</label>
                                    <div class="layui-input-inline">
                                        <input type="text" id="hiredate" name="hiredate" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
                                    </div>
                                </div>
                            </div>
                            <div class="layui-col-md4">
                                <div class="layui-form-item">
                                    <label class="layui-form-label">员工身份证</label>
                                    <div class="layui-input-inline">
                                        <input type="text" id="identitycard" name="identitycard" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="layui-row">
                            <div class="layui-col-md4">
                                <div class="layui-form-item">
                                    <label class="layui-form-label">所属分站</label>
                                    <div class="layui-input-inline">
                                        <select name="subid" id="subid">
                                            <option value="0">请选择分站</option>
                                        </select>
                                    </div>
                                </div>
                            </div>
                            <div class="layui-col-md4">
                                <div class="layui-form-item">
                                    <label class="layui-form-label">学历</label>
                                    <div class="layui-input-inline">
                                        <input type="text" id="education" name="education" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
                                    </div>
                                </div>
                            </div>
                            <div class="layui-col-md4">
                                <div class="layui-form-item">
                                    <label class="layui-form-label">性别</label>
                                    <div class="layui-input-inline">
                                        <input type="text" id="sex" name="sex" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="layui-row">
                            <div class="layui-col-md12">
                                <div class="layui-form-item">
                                    家庭住址
                                    <div class="layui-inline">
                                        <select name="province" id="province1" class="province" lay-verify="required" lay-search lay-filter="province">
                                            <option value="">省份</option>
                                        </select>
                                    </div>
                                    <div class="layui-inline">
                                        <select name="city" id="city1"     class="city" lay-verify="required" lay-search lay-filter="city">
                                            <option value="">地级市</option>
                                        </select>
                                    </div>
                                    <div class="layui-inline">
                                        <select name="district" id="district1" lay-filter="district" class="district" lay-verify="required" lay-search>
                                            <option value="">县/区</option>
                                        </select>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="layui-row">
                            <div class="layui-col-md2">
                                <div class="layui-inline">
                                    <label class="layui-form-label"  style="padding-left: 0px;width: 95px">详细地址</label>

                                    <div class="layui-input-inline">
                                        <input type="tel" name="site" id="site"  required id="detailedAddress1" autocomplete="on" class="layui-input">
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="layui-row">
                            <div class="layui-col-md12">
                                <div class="layui-form-item">
                                    <div class="layui-input-block">
                                        <button type="submit" class="layui-btn" lay-submit  lay-filter="userSubmit">立即提交</button>
                                        <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                                    </div>
                                </div>
                            </div>
                        </div>
                            <input type="hidden" name="personnelId" id="personnelId">
                            <input type="hidden" name="tmsId" id="tmsId">
                    </form>

                </div>
            </div>
        </div>
    </div>
</div>


</body>
</html>
<script src="../../../../start/layui/layui.js"></script>
<script src="../../../../start/layui/js/area2.js"></script>
<script src="../../../../start/layui/js/xcl.js"></script>
<script>

    layui.use(['table', 'form', 'jquery', 'layer', 'tree','util'], function () {
        var tree = layui.tree
            ,$ = layui.jquery
            ,table = layui.table
            ,util = layui.util
            ,form = layui.form
            ,layer = layui.layer;
        $.ajax({
            url:'../../../../selectSubtation'
            ,dataType: "json"
            ,success(data){
                var subi=$("#subii").val();
                alert(subi)
                for (var i=0;i<data.length;i++){
                    if(data[i].subId==subi){
                        alert("1")
                        $("#subid").append(" <option value="+data[i].subId+" selected = \"selected\" >"+data[i].subName+"</option>")
                    }else{
                        $("#subid").append(" <option value="+data[i].subId+">"+data[i].subName+"</option>")
                    }

                }
                form.render('select');
            }
        })
    })

    layui.use(['layer','form'], function() {
        var $ = layui.jquery,form = layui.form;
        //监听提交
        form.on('submit(userSubmit)', function(data){
            $.ajax({
                url:'../../../../updateuser'
                ,data:data.field
                ,type:'post'
                ,dataType: 'json'
                ,success(){
                    var index = parent.layer.getFrameIndex(window.name);    //获取窗口索引
                    parent.layer.close(index);
                }
            })
            return false;
        });
    });
</script>